/**
 * 
 */
function XMLTTemplateParam(paramNode) {
	
	var paramTemplate = '<tr><td><input id="param_name_{name}" value="{name}" onchange="setParamName(\'{name}\', this);" /></td>'
		+ '<td><select id="param_multi_{name}" onchange="setParamMulti(\'{name}\', this);" >'
		+ '<option value="true">true</option>'
		+ '<option value="false">false</option></select></td>'
		+ '<td><select id="param_type_{name}" onchange="setParamType(\'{name}\', this);" >'
		+ '<option value="value">value</option>'
		+ '<option value="link">link</option>'
		+ '<option value="reference">reference</option></select></td>'
		+ '<td><div id="param_ref_{name}" /></td>'
		+ '<td><a href="#" onclick="xmltTemplate.delParam(\'{name}\', this);return false;">delete</a></td>'
		+ '</tr>';
	
	var $el = $(paramNode);
	this.getName = function() {
		return $el.attr('name');
	}
	
	this.setName = function(sName) {
		$el.attr('name', sName);
		setDirtyFlag(true);
	}
	
	this.isMulti = function() {
		return ($el.attr('multiple') == 'true');
	}
	
	this.setIsMulti = function(bIsMulti) {
		$el.attr('multiple', '' + bIsMulti);
		setDirtyFlag(true);
	}
	
	this.getType = function() {
		return $el.attr('type');
	}
	
	this.setType = function(typeValue) {
		$el.attr('type', typeValue);
		setDirtyFlag(true);
	}
	
	this.getRef = function() {
		return $el.attr('ref');
	}
	
	this.setRef = function(ref) {
		$el.attr('ref', ref);
		setDirtyFlag(true);
	}
	
	this.getString = function() {
		return '<parameter name="' + this.getName()
			+ '" multiple="' + this.isMulti()
			+ '" type="' + this.getType()
			+ '" ref="' + this.getRef() + '" />';
	}
	
	this.render = function(id) {
		/*var str = '<parameter name="' + this.getName()
			+ '" multiple="' + this.isMulti()
			+ '" type="' + (this.isValue()? 'value' : 'link')
			+ '" ref="' + this.getRef() + '" />';*/
		$('#' + id).append($($.stringformat(paramTemplate, 
				{name: this.getName(), ref: this.getRef()})));
		$('#param_multi_' + this.getName()).val('' + this.isMulti());
		$('#param_type_' + this.getName()).val(this.getType());
		$('#param_ref_' + this.getName()).html(getRefSelectString(this.getName(), this.getType()));
		$('#param_ref_select_' + this.getName()).val(this.getRef());
	}
}